package controlador;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import modelo.FrasesDao;
import vista.JFJugador;
import vista.JFNivel;

public class ControladorJFNivel implements ActionListener
{
	private JFNivel ventanaNivel;
//	private JFJugador ventanaJugador;
	int n = 0;
	
	public ControladorJFNivel() 

{		super();
	
	ventanaNivel= new JFNivel();
	ventanaNivel.setVisible(true);
	ventanaNivel.setLocationRelativeTo(null);
	ventanaNivel.addListener(this);
	
	
}
	@Override
	public void actionPerformed(ActionEvent e) {
		FrasesDao frasesDao = new FrasesDao();
		String actionCommand = e.getActionCommand();
		
		String frase;
		if (actionCommand.equals("Básico")){
			 n= 1;
			 frase=frasesDao.fraseAleatorea(n);
			new ControladorJFPartida(frase,n);
		}
		else if(actionCommand.equals("Intermedio")){
			 n= 2;
			 frase=frasesDao.fraseAleatorea(n);
				new ControladorJFPartida(frase,n);
		}
		else if(actionCommand.equals("Avanzado")){
			 n= 3;
			 frase=frasesDao.fraseAleatorea(n);
				new ControladorJFPartida(frase,n);
		}
	}
	public int getNivel(){
		return n;
	}
	
	
}